/*
 * @(#)Controller.java 0.0.1-SNAPSHOT
 *
 * Copyright Group B
 */

package grupb.upf.Controller;

import grupb.upf.XMLObjects.New;
import grupb.upf.XMLObjects.Photo;
import grupb.upf.XMLObjects.Video;
import grupb.upf.ms.Content;
import grupb.upf.ms.DescriptionContent;
import grupb.upf.ms.SearchProfile;
import grupb.upf.ms.SearchResult;
import grupb.upf.ms.UserContent;
import java.util.List;

/**
 * <p>This an interface which is used to coordinate the GUI with the
 * Messaging System.</p>
 *
 * @version    0.0.1-SNAPSHOT
 * @author     Group B
 */
public interface Controller {
    /**
     * This method allows us to connect and identif icate to GoogleTalk.
     * @param aLogin is the userName of the Google Account (account@gmail.com)
     * @param aPassword is the password of the Google Account
     * @param resource is the resource, usually "Home"
     * @return boolean (true if it has logged and false if not)
     */
    boolean login(String aLogin, String aPassword, String resource);
    /**
     * Method to logout.
     */
    void logout();
    /**
     * Method to notice the database that the state of the connection.
     * @param state the state of the connection
     * @return true if it was successful or false if not.
     */
    void connectionState(boolean state);
    /**
     * Method to send an error to the GUI.
     * @param err the error
     */
    void addError(String err);
    /**
     * Method to add a connected friend.
     * @param friend the username and resource of the friend
     */
    void addFriend(String friend);
    /**
     * Method to delete a friend.
     * @param friend the username and resource of the disconnected friend
     */
    void removeFriend(String friend);
    /**
     * Method to remove all the friends.
     */
    void removeFriends();
    /**
     * This method allows us to send a SearchProfile to a concrete user.
     * @param sp the object SearchProfile which we are looking for
     * @param to the receiver of the searchProfile message
     */
    void sendSearchProfile(SearchProfile sp, String to);
    /**
     * This method allows us to send a SearchProfile to a all the connected
     * users.
     * @param sp the object SearchProfile which we are looking for
     */
    void sendSearchProfile(SearchProfile sp);
    /**
     * Method to notice the GUI that result of the search has been received.
     * @param dc the DescriptionContent of the result received
     */
    void searchResultReceived(DescriptionContent dc);
    /**
     * Method to send a SearchResult.
     * @param sr the search result to be sent
     * @param to the opponent
     */
    void sendSearchResult(SearchResult sr, String to);
    /**
     * Method to notice the GUI that a content has been received.
     * @param c the Content received
     */
    void contentReceived(Content c);
    /**
     * This method allows us to send UserContent message.
     * @param uc has the description of the Thumbnail received and the
     * necessary information to send the message
     * @param to the destinator of this message
     */
    void sendUserContent(UserContent uc, String to);
    /**
     * Method to notice the GUI that a chat message has been received.
     * @param message the message
     * @param from the opponent
     */
    void chatMessageReceived(String message, String from);
    /**
     * Method to send a chat message to all the connected people.
     * @param msg the message to send
     */
    void sendChatMessage(String msg);
    /**
     * Method to notice the GUI that an instant message has been received.
     * @param msg the message
     * @param from the opponent
     */
    void instantMessageReceived(String msg, String from);
    /**
     * Method to send an instant message to another user.
     * @param msg the message
     * @param to the opponent
     */
    void sendInstantMessage(String msg, String to);
    /**
     * Method to do a localSearch.
     * @param des the DescriptionContent of the searched objects
     */
    void localSearch(DescriptionContent des);
    /**
     * Method to do a localSearch.
     * @param des the DescriptionContent of the searched objects
     * @param from the opponent, who has sent the SearchProfile
     */
    void networkSearch(DescriptionContent des, String from);
    /**
     * Method to get the ontology categories.
     */
    List getTaxonomies();
    /**
     * Method to add a photo to the DB.
     * @param p the photo to be added
     */
    boolean addPhoto(Photo p);
    /**
     * Method to update a photo to the DB.
     * @param p the photo to be updated
     */
    boolean updatePhoto(Photo p);
    /**
     * Method to delete a photo from the DB.
     * @param id the id of the photo to be deleted
     */
    boolean deletePhoto(int id);
    /**
     * Method to get a photo from the DB.
     * @param url the url of the photo
     * @return the photo
     */
    Photo getPhoto(String url);
    /**
     * Method to add a video to the DB.
     * @param v the video to be added
     */
    boolean addVideo(Video v);
    /**
     * Method to update a video to the DB.
     * @param v the video to be updated
     */
    boolean updateVideo(Video v);
    /**
     * Method to delete a video from the DB.
     * @param id the id of the video to be deleted
     */
    boolean deleteVideo(int id);
    /**
     * Method to get a video from the DB.
     * @param url the url of the video
     * @return the video
     */
    Video getVideo(String url);
    /**
     * Method to add a new to the DB.
     * @param nw the new to be added
     */
    boolean addNew(New nw);
    /**
     * Method to update a new to the DB.
     * @param nw the new to be updated
     */
    boolean updateNew(New nw);
    /**
     * Method to delete a new from the DB.
     * @param id the id of the new to be deleted
     */
    boolean deleteNew(int id);
    /**
     * Method to get the list of news.
     * @return the list of news
     */
    List getNews();
}
